<template>
  <div>
    登录成功
    <el-button @click="userLoginOut">退出登录</el-button>

  </div>
</template>

<script setup>
import {logout} from '@/api/authTest.js'
import {takeAccessToken, deleteToken} from "@/utils/request.js";
import {ElMessage} from "element-plus";
import router from "@/router";


function userLoginOut() {
  logout(
      `Bearer ${takeAccessToken()}`
  ).then(resp => {
    console.log(resp)
    deleteToken();
    ElMessage.success("退出登录成功");
    router.push({name: 'welcome-login'});
  })
}
</script>

<style scoped>

</style>